package com.lx.spring.config.condition;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

//自定义逻辑 返回需要导入的组件
public class MyImportSelector implements ImportSelector {

    /**
     * 返回值 就是导入到容器的组件全类名
     * AnnotationMetadata 当前标注了 @Import 注解的类的所有注解信息
     * @param importingClassMetadata
     * @return
     */
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
//        return new String[0];

        return new String[]{"com.lx.spring.config.bean.Blue","com.lx.spring.config.bean.Yellow"};

    }
}
